<template>
  <view :data-theme="theme">
    <CustomNavbar :title="customTitle" />
    <ProForm
      ref="ProFormRef"
      :options="addForm.options"
      :editable="addForm.editable"
      @get-model="from => (addForm.form = from)"
      @save="saveMethod => (addForm.save = saveMethod)"
      @submit="submitForm"
    ></ProForm>
    <BottomButton @right-click="addForm.save" :is-right-btn="addForm.editable" right-text="完成"></BottomButton>
  </view>
</template>
<script setup lang="ts">
import { useForm } from "./hooks/use-addForm";

const { customTitle, setTitle } = useTitle();
const theme = useThemeStore().theme;
console.log(theme, "theme");

const { addForm, submitForm } = useForm();

onLoad(() => {
  setTitle("修改主题", "default");
  setTimeout(() => {
    addForm.form.theme = useThemeStore().theme;
  }, 0);
});
</script>
<style lang="scss" scoped></style>
